<html>
<head>
	<meta charset='utf-8' />
	<title>后台管理</title>
	<meta http-equiv="keywords" content="求职,招聘,房屋,出租,出售,求租,求购,宠物,二手,二手车,二手物品,旧货,寻物,寻人,出兑,外兑"> 
	<meta http-equiv="description" content="便民信息网,房屋租售,宠物交易,二手物品,二手车辆,寻物寻人,出兑信息">  
	<meta name="description" content="便民信息网,房屋租售,宠物交易,二手物品,二手车辆,寻物寻人,出兑信息"/>
	<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0" />
	<style>
		@media screen and (max-width:450px){
			#nav_bottom{width:98%;margin:0 auto}
			#content{width:98%;margin:0 auto}
			/*页面宽度900以下时 .abc的宽度为450*/
		}
		@media screen and (min-width:450px){
			#nav_bottom{width:450px;margin:0 auto}
			#content{width:450px;margin:0 auto}
			/*页面宽度900以下时 .abc的宽度为450*/
		}
		.info_item{color:#444;margin:15px 0;display:flex}
		.info_item > div:last-child{flex:1}
	</style>
</head>
<body style='padding:0;margin:0;background:#eee'>
<!-- 1 Content容器 -->
<div id='Content'>
	<!-- 3 内容区-->
	<div style='margin:10px 0;word-break:break-all;padding:10px;'>
		<div style='float:right;text-align:right' onclick='After_Admin_Exit()'>退出</div>

		<h2 style='text-align:center;'>后台管理-组成员管理</h2>
		<div>当前组：<span id='group_name'></span></div>
		<hr>
		
	

		<div id='a'></div>

		<!--修改密码浮动区-->
		<div id='admin_group_fun_list' style='padding:20px;'>
			<div id='user_list'>

			</div>
		</div>

		<div style='margin:20px;text-align:center'>
			<button onclick='Go_Back()'>返回</button>
		</div>

		<div style='height:100px'></div>			
	
	</div>	<!-- 3 内容区结束-->	

</div><!-- 1 Content容器结束 -->







<!--底部导航容器-->
<div id='Nav_Bottom' style='position:fixed;bottom:0;width:100%;height:45px'>



</body>
</html>


<script src='./Public/jquery.js'></script>
<script src='./Public/fun.js'></script>
<script>
	Check_After_User_Cookie();	//检测登陆状态


	
	var priv_name = 'after_set_group_set_user';
	Priv_Check(priv_name,function(res){
		if(res != 'ok'){
			alert('没有权限!');
			//location.href = document.referrer;
			exit;
		}
	});


	//加载底部导航栏
	Load_NavBottom('after');


	$(function(){

		$('#group_name').text(GetUrlParm('gname'));

		After_Get_Group_User();	//获取组用户信息


	});

	//获取组用户信息
	function After_Get_Group_User(){
		$('#user_list').html('');
		var type = 'After_Get_Group_User';
		Token(type,function(t){
			$.ajax({
				url:url,
				type:'post',
				data:{
					token:t,
					type:type,
					gid:GetUrlParm('gid')
				},
				success(res){
					var data = JSON.parse(res);
					var str = '';
					for(var i=0;i<data.length;i++){
						str += "<div style='border-bottom:1px solid #aaa;padding-bottom:10px'>";
						str += "用户名："+data[i].name;
						str += "<div>备　注："+data[i].explains+"</div>";
						str += "<div style='text-align:right'><button onclick=After_Group_For_User_Del('"+data[i].id+"')>删除</button></div>";
						str += "</div>";
					}
					$('#user_list').html(str);
				}
			});
		});
	}

	function After_Group_For_User_Del(uid){
		var priv_name = 'AfterSetGroupSetUser_UserDel';
		Priv_Check(priv_name,function(res){
			if(res != 'ok'){
				alert('没有权限!');
				//location.href = document.referrer;
				exit;
			}
		});
		if(!confirm('确认删除该用户?')){
			return;
		}
		var type = 'After_Group_For_User_Del';
		Token(type,function(t){
			$.ajax({
				url:url,
				type:'post',
				data:{
					token:t,
					type:type,
					uid,uid
				},
				success(res){
					if(res == 'ok'){
						alert('操作成功！');
						After_Get_Group_User();	//获取组用户信息
					}
				}
			});
		});
	}


	//返回分组页面
	function Go_Back(){
		location.href='after_set_group.html';
	}

</script>

